﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.Solr {
    public class SolrQueryHighlighting {
        public string Query { get; set; }

        public IEnumerable<string> Fields { get; set; }

        public IEnumerable<string> BuildUrlParameters() {
            yield return "hl=true";

            if (!string.IsNullOrWhiteSpace(Query))
                yield return string.Format("hl.q={0}", Query);

            if (Fields != null)
                yield return string.Format("hl.fl={0}", string.Join(",", Fields));
        }
    }
}
